import React from 'react';
import { ConfigProvider, Layout } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';

import BasicHeader from '@/components/BasicHeader';
import SubSystemHeader from '@/components/SubSystemHeader';
import styles from './BasicLayout.less';


const { Content } = Layout;

function BasicLayout({ children, location }) {
  // const path = location.pathname.split('/');
  let header = (<BasicHeader></BasicHeader>);
  if(location.pathname.startsWith('/subSystemm')) {
    header = (<SubSystemHeader></SubSystemHeader>);
  }
  return (
    <ConfigProvider locale={zhCN}>
      <Layout className={styles.basicLayout}>
        {header}
        <Content className={styles.content}>
          {/*<Scrollbars autoHide>{ children }</Scrollbars>*/}
          { children }
        </Content>
        {/*<GlobalFooter/>*/}
      </Layout>
    </ConfigProvider>
  );
}

export default BasicLayout;
